package dto

import "web_api_gin/entity"

//菜单大结构
type SysPermissionTree struct {
	entity.SysPermission
	Children []*SysPermissionTree `json:"children"` //子菜单列表
}

//权限列表获取参数数据结构
type SysPermissionGetListReq struct {
	Name        string `form:"name"`         // 权限定义名
	DisplayName string `form:"display_name"` // 权限显示名
}

//权限删除表单
type SysPermissionFormDestroy struct {
	PermIds []uint32 `form:"perm_ids" json:"perm_ids" binding:"dive,required"` // 权限ID
}

//排序拖拽请求参数
type SysPermissionSetOrderRequest struct {
	DropType     string                        `form:"dropType" binding:"required"`      //拖拽类型
	DraggingNode SysPermissionSetOrderDragNode `form:"draggingNode" json:"draggingNode"` //拖拽中的节点
	DropNode     SysPermissionSetOrderDragNode `form:"dropNode" json:"dropNode"`         //放置的目标节点
}

// 拖拽数据节点结构
type SysPermissionSetOrderDragNode struct {
	PermId      uint32 `form:"perm_id" json:"perm_id"`           //权限ID
	Name        string `form:"name" json:"name"`                 //权限定义名
	DisplayName string `form:"display_name" json:"display_name"` //权限显示名
	ParentId    uint32 `form:"parent_id" json:"parent_id"`       //父级ID
	OrderNum    uint32 `form:"order_num" json:"order_num"`       //排序数字
}
